package org.hentor.config.redis.client;

import org.hentor.config.redis.BaseMap;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

import javax.annotation.Resource;

@Configuration
public class HentorRedisClient {
    @Resource
    private RedisTemplate<String, Object> redisTemplate;

    public HentorRedisClient() {
    }

    public void sendMessage(String handlerName, BaseMap params) {
        params.put("handlerName", handlerName);
        this.redisTemplate.convertAndSend("hentor_redis_topic", params);
    }
}
